<?php

class IndexController extends Zend_Controller_Action
{

	public function init()
	{


	}

	public function indexAction()
	{
		echo "Hello your are Testing WSSG";
		//$n = new Macys_Api_V2_Catalog_Category();
		//var_dump($n->getCategory());

	}
	
	public function addAction()
	{
		$this->getHelper('viewRenderer')->setNoRender();
		echo "This is ADD";
	}

	public function testAction() {
		$a = new Macys_Base_Test();
		$a->getRf('hi');
		$this->getHelper('viewRenderer')->setNoRender();
	}

	public function vasicallAction() {
		$this->getHelper('viewRenderer')->setNoRender();
		$username = 'yc30v1m@macys.com';
		$password = 'vasi123';
		$url = "http://208.113.76.168/WebsiteServicesGateway/v2/oauth/token";
			$curlConf = array( 'adapter'   => 'Zend_Http_Client_Adapter_Curl',
    				'curloptions' => array(CURLOPT_FOLLOWLOCATION => true),	);
			$client = new Macys_Base_Test();
			try {
			$client->setUri($url);
			
			$client->setAuth("7xydgv2mvrqc9nc2mrctjhv8", "eAgBfdun7GyA84n5KQDsjdCZ");
			$client->setEncType('application/x-www-form-urlencoded');
			$client->setParameterPost('username' , $username);
			$client->setParameterPost('password', $password);
			$client->setParameterPost('grant_type', 'password');
			$client->setHeaders('Accept', 'application/json');
			$client->request('POST');
			$result = Zend_Json::decode($client->getLastResponse()->getBody(), Zend_Json::TYPE_ARRAY);
			var_dump($result);
			}
			catch (Exception $e) {
				var_dump($e);
			}
	}
	
}







